package cn.hy;


import io.netty.util.HashedWheelTimer;
import io.netty.util.Timeout;
import io.netty.util.TimerTask;

import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Date;
import java.util.UUID;
import java.util.concurrent.TimeUnit;

public class Main {

    public static void main(String[] args) {
        Path path = Paths.get(Main.class.getResource("/").getPath(), UUID.randomUUID().toString()+ "."+1);
        System.out.println(path);

        HashedWheelTimer timer = new HashedWheelTimer(1, TimeUnit.SECONDS, 8);

        System.out.println("date:" + new Date());
        timer.newTimeout(new TimerTask() {
            @Override
            public void run(Timeout timeout) throws Exception {
                System.out.println( new Date() + " 执行！！");
            }
        },9,TimeUnit.SECONDS);
    }
}
